package com.ssish.saas.eccs.service;

import com.ssish.saas.eccs.mapper.PlanMastInfoMapper;
import com.ssish.saas.eccs.model.PlanMastInfoExample;
import com.ssish.saas.eccs.model.PlanMastInfoWithBLOBs;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PlanMastService {
    @Autowired
    private PlanMastInfoMapper planMastInfoMapper;

    public PlanMastInfoWithBLOBs getPlanMastInfoMapper(String payorCode,String corCode,String planCode) {
        PlanMastInfoExample example = new PlanMastInfoExample();
        example.createCriteria().andPayorCodeEqualTo(payorCode).andCorpCodeEqualTo(corCode).andPlanCodeEqualTo(planCode);
        List<PlanMastInfoWithBLOBs> planMastInfoWithBLOBsList =  planMastInfoMapper.selectByExampleWithBLOBs(example);
        if(planMastInfoWithBLOBsList != null && planMastInfoWithBLOBsList.size()>0){
            return planMastInfoWithBLOBsList.get(0);
        }
        return null;
    }
}
